package com.ht.service.impl;

import com.ht.domain.bo.PopularizationBO;
import com.ht.domain.po.TbPopularization;
import com.ht.dto.TbPopularizationDTO;
import com.ht.mapper.PopularizationMapper;
import com.ht.service.PopularizationService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 科普号service
 */
@Service
public class PopularizationServiceImpl implements PopularizationService {

    @Autowired
    private PopularizationMapper popularizationMapper;


    @Override
    public int addPopularization(Long doctorId, PopularizationBO popularizationBO) {
        TbPopularization popularization = new TbPopularization();
        BeanUtils.copyProperties(popularizationBO,popularization);
        popularization.setStatus(0);
        popularization.setDoctorId(doctorId);
        return popularizationMapper.insert(popularization);
    }
}
